package com.bonc.config;

import com.bonc.entity.Employee;
import com.bonc.interceptor.MyInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author lenovo
 * @Title
 * @Description
 * @date 2021/7/27 11:19
 */
@Configuration
public class Myconfig implements WebMvcConfigurer{


    /**
     * <mvc:interceptors>
     *  <mapping></mapping>
     *  <exclud-mapping></exclud-mapping>
     * </interceptors>
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**").excludePathPatterns("/login");
    }
}
